package controller

import (
	"encoding/json"
	"fmt"
	"gowork/memberHero/model"
	"gowork/memberHero/service"
)

func PostMicroinsert(service service.StudentSriCuda, form model.InfoForm) map[string]string {

	var mList []*model.Member
	if uerr := json.Unmarshal([]byte(form.Info), &mList); uerr == nil{
		fmt.Println(mList)
		receive := service.InesrtSri(mList)
		if receive["code"] == "200"{
			return receive
		}else{
			return map[string]string{"message":"插入失败", "code":"500"}
		}
	}else{
		return map[string]string{"message":"解析失败", "code":"500"}
	}
}

func PostMicroquery(service service.StudentSriCuda) []*model.Member {
	return service.QuerySri()
}


